package com.xc.hotelmgr.order.common.utils;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;


public class HttpClient {

    /**
     * post提交
     * @param o
     * @param url
     * @return
     */
    public static String doPost(Object o, String url) {
        String pushData = JSON.toJSONString(o);
        return HttpRequest.post(url)
                .body(pushData)
                .execute()
                .body();
    }

    /**
     * get提交
     * @param url
     * @return
     */
    public static String doGet(String url) {
        return HttpRequest.get(url)
                .execute()
                .body();
    }
}